<script setup>
import {useRouter} from "vue-router";

let username = localStorage.getItem("username");
let router = useRouter();
let logout = () => {
  localStorage.removeItem("username");
  router.push("/login");
};
</script>

<template>
  <h1>Home.vue</h1>
  <h3>欢迎您 , {{ username }}} , <input type="button" value="注销" @click="logout"> </h3>
</template>

<style scoped>

</style>